# -*- coding:utf-8 -*-
# 文件的打开
#file_obj=open(filename,mode='r',buffering=-1)
'''
mode可选 ，默认为r 
buffering可选，默认-1 0不缓冲 1缓冲一行 大于1自行设定
'''
f1=open(r'd:\test\x.txt')
f2=open(r'd:\test\xx.txt','w')
'''
r  读
w  写
a  追加
r+ = r+w
w+ = w+r
a+ = a+r
rb  rb+
wb wb+
ab ab+
f.read()
f.write()
f.readline()
'''
f=open(r'd:\test\first.txt','w')
f.write('.LOG')
f.close()
f=open(r'd:\test\first.txt','r')
p1=f.read(5)
p2=f.read()
f=open(r'd:\test\first.txt')
cNames=f.readlines()
print cNames
for i in range(0,len(cNames)):
    cNames[i]=str(i+1)+''+cNames[i]

f.close()
f=open(r'd:\test\first.txt','w')
f.writelines(cNames)
f.close()



